
var scroll_pixel,div_pixel,gtpos,gbpos,loop,moving_spd;
var top_margin = 0;
var top_margin2 = 0;
var speed = 10;
var speed2 = 30;
var moving_stat = 1;

function check_scrollmove()
{
if(document.body && (document.body.scrollLeft || document.scrollTop)){
scroll_pixel = document.body.scrollTop;
gtpos = document.body.scrollTop+top_margin;
gbpos = document.body.scrollTop+top_margin2;
}else if(document.documentElement &&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{
scroll_pixel = document.documentElement.scrollTop;
gtpos = document.documentElement.scrollTop+top_margin;
gbpos = document.documentElement.scrollTop+top_margin2;
}
if(div_id.style.pixelTop < gtpos)
{
moving_spd=(gbpos-div_id.style.pixelTop)/speed;
div_id.style.pixelTop += moving_spd;
}
if(div_id.style.pixelTop > gtpos)
{
moving_spd=(div_id.style.pixelTop-gtpos)/speed;
div_id.style.pixelTop -= moving_spd;
}
loop = setTimeout("check_scrollmove()",speed2);
}
function moving_control()
{
if(!moving_stat){check_scrollmove(); moving_stat=1;
}
else{clearTimeout(loop); moving_stat=1; div_id.style.pixelTop = top_margin;
new check_scrollmove(document.getElementById("div_id"),0,0,30,10);
}
}
function init(){
	new check_scrollmove(document.getElementById("div_id"),0,0,30,10);
}